package core.util;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

import core.discovery.WorkerDiscovery;
import core.interfaces.Discovery;
import core.manager.Manager;
import core.ui.UI;

/**
 *
 * @author Vincenzo Merlo, Scuderi Giovanni Luca, Paolo Giuffrida
 */
public class COREServiceRegistry {

    private static Logger logger = null;

    /**
     *
     * @param name
     * @return
     */
    public static Logger getLogger(String name) {
        if (logger == null) {
            BasicConfigurator.configure();
        }
        logger = Logger.getLogger(name);
        return logger;
    }

    /**
     *
     * @return
     */
    public static Manager getManager() {
        return Manager.getInstance();
    }

    /*
     * TODO: NOT IMPLEMENTED YET
     */
    /**
     *
     * @return
     */
    public static Discovery getDiscovery() {
        return WorkerDiscovery.getInstance();
    }

    /**
     * 
     * @return
     */
    public static IDTaskDescriptorManager getIDTaskDescriptorManager() {
        return IDTaskDescriptorManager.getInstance();
    }

    /**
     *
     * @return
     */
    public static IDWorkflowManager getIDWorkflowManager() {
        return IDWorkflowManager.getInstance();
    }

    //TODO : DA VEDERE SE E' GIUSTO
    /**
     *
     * @return
     */
    public static UI getUI() {
        UI ui = new UI();
        return ui;
    }
}
